import request from '@/utils/http.js'


// 获取分类数据
export const getCategoryListApi = () => {
  return request({
    url: 'pms/backend/category/tree',
    method: "GET",
  })
}

// 添加分类
export const saveCategoryInfoApi = (data) => {
  return request({
    url: 'pms/backend/category/save',
    method: "POST",
    data: JSON.stringify(data),
  })
}

// 获取单个分类信息
export const getCategoryInfoApi = (id) => {
  return request({
    url: `pms/backend/category/info/${id}`,
    method: "GET",
  })
}

// 修改分类数据
export const updateCategoryInfoApi = (data) => {
  return request({
    url: 'pms/backend/category/update',
    method: "PUT",
    data: JSON.stringify(data),
  })
}

// 删除分类数据
export const deleteCategoryApi = (ids) => {
  return request({
    url: 'pms/backend/category/delete',
    method: "DELETE",
    data: JSON.stringify(ids),
  })
}